const app = getApp()
const amapFile = require('../../libs/amap-wx')

Page({
    data:{
        markers:[{
            iconPath: "/images/icon/30-Point.png",
            id: 0,
            latitude:22.55331,
            longitude: 113.88300,
            width: 15,
            height: 20,
            callout:{
                content:"姓       名：你猜啊\n班组人数:65人",
                color:"#FFFFFF",
                borderRadius:10,
                bgColor:"#000",
                fontSize:16,
                padding:10
            }
        }],
        longitude:113,
        latitude:35,
        myAmapFun:null
    },
    switchMap(){
        wx.redirectTo({
            url: '/pages/project/index'
        })
    },
    onLoad(){
        this.setData({
            myAmapFun:new amapFile.AMapWX({key:'1bf7233ac6e789c1f88df7c93ea45c6a'})
        })
        wx.getLocation({
            type:'gcj02',
            success:res=>{
                console.log(res)
                this.setData({
                    longitude:res.longitude,
                    latitude:res.latitude
                })
            }
        })
        app.axios('/craftsman/map','GET',response=>{
            if (response){
                console.log(response.list)
                this.setData({
                    markers:[...response.list]
                })
            }
        })
    },
    showArea(){

    }
})
